const gchar *path,
gboolean reset,
GError **error);
-static void gtk_css_provider_take_error (GtkCssProvider *provider,
- GScanner *scanner,
- GError *error);
GQuark
gtk_css_provider_error_quark (void)
g_type_class_add_private (object_class, sizeof (GtkCssProviderPrivate));
}
+static void
+gtk_css_provider_take_error_full (GtkCssProvider *provider,
+ GFile *file,
+ guint line,
+ guint position,
+ GError *error)
+{
+ char *filename;
+
+ if (file)
+ filename = g_file_get_path (file);
+ else
+ filename = NULL;
+
+ g_signal_emit (provider, css_provider_signals[PARSING_ERROR], 0,
+ filename, line, position, error);
+
+ g_free (filename);
+ g_error_free (error);
+}
+
static SelectorPath *
selector_path_new (void)
{
if (found)
break;
- gtk_css_provider_take_error (GTK_CSS_PROVIDER (provider), NULL, error);
+ /* error location should be _way_ better */
+ gtk_css_provider_take_error_full (GTK_CSS_PROVIDER (provider),
+ NULL,
+ 0, 0,
+ error);
}
}
GScanner *scanner,
GError *error)
{
- char *filename;
- guint line, position;
-
- if (scanner)
- {
- GtkCssScannerPrivate *priv = scanner->user_data;
- if (priv->file)
- filename = g_file_get_path (priv->file);
- else
- filename = NULL;
- line = scanner->line;
- position = scanner->position;
- }
- else
- {
- filename = NULL;
- line = 0;
- position = 0;
- }
-
- g_signal_emit (provider, css_provider_signals[PARSING_ERROR], 0,
- filename, line, position, error);
+ GtkCssScannerPrivate *priv = scanner->user_data;
- g_free (filename);
- g_error_free (error);
+ gtk_css_provider_take_error_full (provider,
+ priv->file,
+ scanner->line,
+ scanner->position,
+ error);
}
static void